package sy1;
    class Student{
        private String name;private int age;private boolean male;
        public void setAge(int age) {this.age = age;}
        public int getAge() {return age;}
        public void setMale(boolean male) {this.male = male;}
        public String getName() {return name;}
        public void setName(String name) {this.name = name;}
        public boolean isMale(){return male;}
        public  Student(String name,int age,boolean male){this.male=male;this.age=age;this.name=name;}
        public String toString(){return ("我叫:"+name+","+"年龄:"+age);}
        public void get(){if (age>70||age<6) {System.out.println(",age is error");}}
        public void is(){if(male=true) {System.out.print(","+"性别:"+"男");}
        else if(male=false){System.out.print(","+"性别"+"女");}}}
    public class demo1 {
        public static void main(String[] args) {
            Student stu = new Student("鹿晗",20,true);
            System.out.println("姓名：" + stu.getName());
            System.out.println("年龄：" + stu.getAge());
            System.out.println("是不是男生：" + stu.isMale());
            System.out.print(stu.toString());stu.is();stu.get();}}

